﻿<%@ Page Title="Sensor Web Application" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SensorWebApplication._Default" %>
<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1><%: Title %></h1>
            </hgroup>
        </div>
    </section>
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <asp:SqlDataSource ID="SqlAzureDataSource" runat="server" 
       ConnectionString="<%$ ConnectionStrings:SQLConnection %>" 
       SelectCommand="SELECT * FROM [TemperatureTable]" 
       DeleteCommand="DELETE FROM [TemperatureTable] WHERE [ID] = @ID">
       <DeleteParameters>
          <asp:Parameter Name="ID" Type="Int32" />
       </DeleteParameters>
    </asp:SqlDataSource>
    <asp:GridView ID="DataGridView" runat="server" AutoGenerateDeleteButton="True" DataSourceID="SqlAzureDataSource" DataKeyNames="ID" AutoGenerateColumns="false">
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="ID" />
            <asp:BoundField DataField="Temperature" HeaderText="Temperature" />
        </Columns>
    </asp:GridView>
</asp:Content>
